/*!
 * \file GapGlobals.h
 * \brief Global definitions for GAP protocol
 */

#ifndef SGW_GAP_GLOBALS_H
#define SGW_GAP_GLOBALS_H

#include "EventData.h"
#include "GAP.pb.h"
#include "map"

namespace tsc
{
namespace sgw
{

using common::SIGNO;
using common::SIGNAL_BASE;
using namespace GatewayApplicationPart;

class GapGenerator;

std::map<uint32_t, GapGenerator*>& gGapGeneratorMap();

//===================================================================
// GatewayApplicationPart signal numbers
//===================================================================
const SIGNO GAP_SIGNAL_BASE       = SIGNAL_BASE + 0x00002000;
const SIGNO GAP_SIGNAL_TIMER_BASE = SIGNAL_BASE + 0x00002200;

const SIGNO GAP_CONNECTION_IND =
		GAP_SIGNAL_BASE + GAP_PDU_CONNECT_IND;

const SIGNO GAP_ECHO_RESPONSE =
		GAP_SIGNAL_BASE + GAP_PDU_ECHO_RES;

const SIGNO GAP_MEDIA_BEARER_RELEASE =
        GAP_SIGNAL_BASE + GAP_PDU_MEDIA_BEARER_RELEASE;

const SIGNO GAP_MEDIA_BEARER_SETUP_CFM =
        GAP_SIGNAL_BASE + GAP_PDU_MEDIA_BEARER_SETUP_CFM;

const SIGNO GAP_MEDIA_BEARER_SETUP_REJ =
        GAP_SIGNAL_BASE + GAP_PDU_MEDIA_BEARER_SETUP_REJ;

const SIGNO GAP_MEDIA_TRANSMISSION_END =
        GAP_SIGNAL_BASE + GAP_PDU_MEDIA_TRANSMISSION_END;

const SIGNO GAP_T823_EXPIRED =
        GAP_SIGNAL_TIMER_BASE + 1;

const SIGNO GAP_T8221_EXPIRED =
        GAP_SIGNAL_TIMER_BASE + 2;

//===================================================================
// Timers
//===================================================================
const unsigned long T_823_VALUE = 60000; // 60s
const unsigned long T_8221_VALUE = 3000; //  3s

const uint32_t GAP_MGW_INITIAL_ID = 0xFFFFFFFF;

} // namespace sgw
} // namespace tsc

#endif // SGW_GAP_GLOBALS_H
